package com.cskaoyan.market.admin.service.impl;

import com.cskaoyan.market.admin.service.MarketCollectService;
import com.cskaoyan.market.db.domain.MarketCollect;
import com.cskaoyan.market.db.domain.MarketCollectExample;
import com.cskaoyan.market.db.mapper.MarketCollectMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yuanixn2158@163.com
 * @since 2023/05/08 22:41
 */
@Service
public class MarketCollectServiceImpl implements MarketCollectService {
    @Autowired
    private MarketCollectMapper addressMapper;

    @Override
    public List<MarketCollect> getCollectList(int page, int limit, String sort, String order) {
        
        MarketCollectExample marketCollectExample = new MarketCollectExample();
        marketCollectExample.orderBy(sort+" "+order);
        PageHelper.startPage(page,limit);
        List<MarketCollect> marketCollects = addressMapper.selectByExample(marketCollectExample);
        
        

        return marketCollects;
    }
}
